var zym;
var yzmtime = 60;

function hqyzm(phone, getCode) {
    console.log(phone)
    var html = $(".yzm").html();
    if (html == "获取验证码") {
        if (!regTel(phone)) {
            pop.notice('请输入正确的手机号');
            return;
        }
        //验证通过
        getCode(function () {
            console.log('发送成功');
            pop.notice("短信验证码已发送");
            $(".yzm").addClass("on");
            $(".yzm").html(yzmtime + "秒后可重新获取");
            zym = setInterval(yzmsetInterval, 1000);
        });

    }
}

//验证码倒计时

function yzmsetInterval() {
    yzmtime = Number(yzmtime) - 1;
    var html = "";
    if (yzmtime == 0) {
        html = "获取验证码";
        yzmtime = 60;
        $(".yzm").removeClass("on");
        clearInterval(zym);
    } else {
        html = yzmtime + "秒后可重新获取";
    }
    $(".yzm").html(html);
}
